import request from '@/utils/request';

export const getUserList = (data) => {
    return request({
        url: `sys/user/list`,
        data,
        method: 'post'
    });
};
export const updateUserStatus = (data) => {
    return request({
        url: `sys/user/updateUserStatus`,
        data,
        method: 'post'
    });
};

export const deleteUser = (data) => {
    return request({
        url: `sys/user/delete`,
        data,
        method: 'post'
    });
};
export const resetPwd = (id) => {
    return request({
        url: `sys/user/resetPwd/${id}`,
        method: 'get'
    });
};

export const checkUserName = (data) => {
    return request({
        url: `sys/user/checkUserName`,
        data,
        method: 'post'
    });
};
export const checkPhone = (data) => {
    return request({
        url: `sys/user/checkPhone`,
        data,
        method: 'post'
    });
};
export const checkEmail = (data) => {
    return request({
        url: `sys/user/checkEmail`,
        data,
        method: 'post'
    });
};
export const saveUser = (data) => {
    return request({
        url: `sys/user/save`,
        data,
        method: 'post'
    });
};
export const getUserById = (id) => {
    return request({
        url: `sys/user/${id}`,
        method: 'get'
    });
};
export const updateAvatar = (data) => {
    return request({
        url: `sys/user/updateAvatar`,
        data,
        method: 'post'
    });
};
export const updateUserPwd = (data) => {
    return request({
        url: `sys/user/updateUserPwd`,
        data,
        method: 'post'
    });
};
